home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / P_ROBO31.ZIP / COWARD.PR < prev    next >
Text File  |  1993-02-25  |  1KB  |  41 lines

  1.   PROCEDURE Coward;
  2.  
  3.   {
  4.    Author: David Malmberg
  5.  
  6.    Strategy: Raise shield.  Go to a top left corner and wait.  Never fire.
  7.              Conserve fuel and try to out last opponents and win by default.
  8.  
  9.              When using fuel, this robot can be suprisingly effective.
  10.              If not using fuel, its "sitting-duck" strategy makes it easy
  11.              prey.
  12.   }
  13.  
  14.  
  15.     PROCEDURE GOTO(x, y : Integer);
  16.       { Go to location X,Y on playing field. }
  17.     VAR Heading    : Integer;
  18.     BEGIN
  19.       { Find the heading we need to get to the desired spot. }
  20.       Heading := Angle_To(x, y);
  21.  
  22.       { Keep traveling at top speed until we are within 150 meters }
  23.       WHILE (distance(loc_x, loc_y, x, y) > 150) DO Drive(Heading, 100);
  24.  
  25.       { Cut speed, and creep the rest of the way. }
  26.       WHILE (distance(loc_x, loc_y, x, y) > 20) DO Drive(Heading, 20);
  27.  
  28.       { Stop driving, should coast to a stop. }
  29.       Drive(Heading, 0); {I.E., Stop}
  30.     END; {GoTo(X,Y)}
  31.  
  32.  
  33.   BEGIN {Coward Main}
  34.     RaiseShield;
  35.     GoTo(0,999); {Top left corner}
  36.     REPEAT
  37.     {emtpy -- do nothing}
  38.     UNTIL Winner OR Dead;
  39.   END; {Coward Main}
  40.  
  41.